package com.jsle.financial.util;
import java.io.IOException;
import java.util.Date;

import org.codehaus.jackson.JsonGenerator;
import org.codehaus.jackson.JsonProcessingException;
import org.codehaus.jackson.map.JsonSerializer;
import org.codehaus.jackson.map.SerializerProvider;
import org.springframework.stereotype.Component;

/**
 * 日期格式
 * 
 * @Title: JsonDateSerializer.java
 * @Description: <br>
 * <br>
 * @Created on Nov 10, 2012 2:21:26 PM
 * @author lixbh
 * @version $Revision: 1.1.2.2 $
 * @since 1.0
 */
@Component 
public class JsonDateSerializer extends JsonSerializer<Date>{

    @Override
    public void serialize(Date date, JsonGenerator gen, SerializerProvider provider)
            throws IOException, JsonProcessingException {
	gen.writeString(DateUtil.format(date));
    }

}

